Skip to main content

Integrating Keys into Application Code

This section provides guidance on integrating the obtained API keys from OpenAI and Upstash into your application code. By following these steps, you'll ensure that your application has access to the necessary credentials for utilizing OpenAI's AI capabilities and Upstash's Redis database functionality effectively.

Step 1: Open Your Application Code in VSCode

Launch Visual Studio Code (VSCode) and open the codebase of your application.

Step 2: Locate the .env File

Navigate to the root directory of your project and find the .env file. This file typically stores environment variables for your application.

vscode

Step 3: Paste Your Keys

Open the .env file and locate the section where environment variables are defined. Paste your OpenAI key, Redis URL, and Redis secret into this section. Ensure that each key is properly formatted and separated from others as per the file's syntax.

vscode

Step 4: Save the .env File

Once you have pasted the keys, save the changes to the .env file. This ensures that your application can access the necessary credentials securely during runtime.

By completing these steps, you have successfully integrated the required keys into your application code, enabling seamless interaction with OpenAI and Upstash services.